Imports CapaDeNegocios

Partial Public Class FrmLogin
    Inherits System.Web.UI.Page
    Public Login As CapaDeNegocios.nLogin = New CapaDeNegocios.nLogin


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            
        End If
        TxtUsuario.Focus()
    End Sub

    Protected Sub LinkIngreso_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinkIngreso.Click
        Dim Datos As DataSet = New DataSet
        If Len(Trim(TxtUsuario.Text)) > 1 And Len(Trim(TxtClave.Text)) > 0 Then
            If (Login.IngresoCorrecto(Trim(TxtUsuario.Text), Trim(TxtClave.Text))) Then
                'Login.TipoUsuario(TxtUsuario.Text, TxtClave.Text)
                Session("Login") = TxtUsuario.Text
                'Me.Response.Write("<script languaje='javascript'>window.opener.location.reload();</script>")
                'Me.Page.ClientScript.RegisterStartupScript(Me.Page.GetType(), "lala", "<script languaje='javascript'>window.opener.location.reload();</script>")
                'cadena = "<script language=""javascript"">" + "window.opener.location.href=window.opener.location.href; window.close(); </script>"
                'cadena = "<script languaje='javascript'> "
                'cadena += "window.close();"
                'cadena += "</script>"
                'Me.Response.Write("<script languaje='javascript'>window.close()</script>")
                'Me.Response.Write("<script languaje='javascript'>window.alert('Ustedttttoa')</script>")
                Me.Response.Write("<script languaje='javascript'>window.opener.location.replace('default.aspx');window.close();</script>")                'Response.Redirect("/")
                'Page.ClientScript.RegisterStartupScript(Page.GetType(tgb.Master), "hola", cadena)
            Else
                Me.Response.Write("<script languaje='javascript'>window.alert('Verifique Usuario y Contrasena, contacte al administrador')</script>")
            End If

        Else
            Me.Response.Write("<script languaje='javascript'>window.alert('Los datos ingresados no son Correctos')</script>")
        End If
    End Sub
End Class